<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
  <head>
    <th:block th:replace="~{/_include/header}" />
    <link rel="stylesheet" type="text/css" th:href="@{/assets/css/list-page.css}" />
    <title th:text="${title}"></title>
    <style>
      .iframe-wrap {
        margin-top: 44px;
        overflow: hidden;
        border-radius: 0 0 3px 3px;
        border: 1px solid #ddd;
      }
      .iframe-wrap iframe {
        position: relative;
        overflow: hidden;
        width: 100%;
        height: 100%;
        min-height: 300px;
        padding: 0;
        font-size: 0;
        line-height: 1;
      }
      .quick-filter-tabs a.dropdown-item {
        background-color: #f5f5f5;
        border-radius: 2px !important;
      }
      .quick-filter-tabs a.dropdown-item:hover {
        background-color: #ddd;
      }
    </style>
  </head>
  <body>
    <div class="rb-wrapper rb-fixed-sidebar rb-collapsible-sidebar rb-collapsible-sidebar-hide-logo" th:classappend="${sideCollapsedClazz}">
      <th:block th:replace="~{/_include/nav-top}" />
      <th:block th:replace="~{/_include/nav-left}" />
      <div class="rb-loading rb-loading-active must-center J_dock-load">
        <th:block th:replace="~{/_include/spinner}" />
      </div>
      <div class="rb-content">
        <div class="main-content container-fluid">
          <div class="quick-filter-tabs">
            <div>
              <a class="dropdown-item" th:href="|../${entityName}/list|">[[${bundle.L('返回列表')}]]</a>
            </div>
          </div>
          <div class="iframe-wrap hide">
            <iframe frameborder="0" scrolling="auto"></iframe>
          </div>
        </div>
      </div>
    </div>
    <th:block th:replace="~{/_include/footer}" />
    <script>
      window.__PageConfig = {
        viewUrl: '[[${viewUrl}]]',
      }
    </script>
    <th:block th:replace="~{/_include/forms}" />
    <script type="text/babel">
      const RbViewModal = {
        hideClose: true,
        create: function (props, subView) {
          location.href = `${rb.baseUrl}/app/entity/view?id=${props.id}`
        },
        holder: function (id, action) {
          return {
            hideLoading: function () {},
          }
        },
        currentHolder() {
          return RbViewModal.holder()
        },
      }

      $(document).ready(() => {
        $addResizeHandler(() => {
          const mh = $(window).height() - 61 - 40 - 44
          $('.iframe-wrap').css({ height: mh })
        })()

        const wpc = window.__PageConfig
        setTimeout(() => $('.iframe-wrap iframe').attr('src', wpc.viewUrl), 0)
        setTimeout(() => $('.iframe-wrap').removeClass('hide'), 100)
      })
    </script>
  </body>
</html>
